<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
<script>


let money = 0
while(true){
  let ATM=+prompt(`
  请输入你的操作
  1.取款
  2.存款
  3.查看余额
  4.退出
  `)

if(ATM ===4){
  break
}

switch(ATM){
  case 1:
    let qk = +prompt('取多少')
    if(money<=0){
      alert('没钱破产了')
      break
    } else if(money<qk){
      alert(`余额不足，只能取${money}`)
      break
    }else if(qk % 100 !== 0){
      alert('只能取整百数')
      break
    }
    money -= qk
    alert(`余额还剩余${money}`)
    break
  case 2:
    let ck = +prompt('存多少')
    if(ck %100 !==0){
      alert('请存入整百数')
      break
    }
    money += ck
    alert(`余额还剩余${money}`)
    break
  case 3:
    alert(`余额还有${money}`)
    break
default:
  alert('请输入正确的操作')
  break
}

}

  </script>
</body>
</html>